<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--[if IE 9 ]><html class="ie9"><![endif]-->
    <head>
        <%@ include file="../frame_head.jsp" %>
            
        <!-- CSS -->
        <link href="${pageContext.request.contextPath }/css_b/bootstrap.min.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath }/css_b/animate.min.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath }/css_b/font-awesome.min.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath }/css_b/form.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath }/css_b/calendar.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath }/css_b/media-player.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath }/css_b/style.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath }/css_b/icons.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath }/css_b/generics.css" rel="stylesheet"> 
    </head>
    <body id="skin-blur-violate">
        <!-- header -->
        <%@ include file="../frame_header.jsp" %>
        
        <section id="main" class="p-relative" role="main">
	        <!-- Sidebar -->
	        <%@ include file="../frame_aside.jsp" %>
          
            <!-- Content -->
            <section id="content" class="container">
		        <!-- Breadcrumb -->
				<ol class="breadcrumb hidden-xs">
				    <li><a href="#">主页</a></li>
				    <li class="active">数据</li>
				</ol>
				
				<h4 class="page-title">列表</h4>
                
                <!-- Deafult Table -->
                <div class="block-area" id="defaultStyle">
                    <h3 class="block-title">一级分类列表</h3>
                    <form action="">
                    <table class="table tile">
                        <thead style="white-space:nowrap;">
                            <tr>
                                <th style="text-align: center;">序号</th>
                                <th style="text-align: center;">一级分类ID</th>
                                <th style="text-align: center;">一级分类名称</th>
                                <th style="text-align: center;">编辑</th>
                                <th style="text-align: center;">删除</th>
                            </tr>
                        </thead>
                        <tbody>
                            <s:iterator var="c" value="pageBean.List" status="status">
								<tr >
									<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="18%">
										<s:property value="#status.count"/>
									</td>
									<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="17%">
										<font color="orange"><s:property value="#c.cid"/></font>
									</td>
									<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="17%">
										<font color="orange"><s:property value="#c.cname"/></font>
									</td>
									<td align="center" style="HEIGHT: 22px">
										<a href="${pageContext.request.contextPath}/adminCategory_edit.action?cid=<s:property value="#c.cid"/>">
											<img src="${pageContext.request.contextPath}/images/i_edit.png" width="16" height="16" border="0" style="CURSOR: hand">
										</a>
									</td>
									<td align="center" style="HEIGHT: 22px">
										<a href="#" onclick="deleteCategory(<s:property value="#c.cid"/>)">
											<img src="${pageContext.request.contextPath}/images/i_del.jpg" width="16" height="16" border="0" style="CURSOR: hand">
										</a>
									</td>
								</tr>
							</s:iterator>	
                        </tbody>
                    </table>
                    <center>
	                	<button type="button" id="add" name="add" value="添加" onclick="addCategory()" class="btn btn-sm m-r-5">添加一级分类</button>
						<p />
						<div>
							第<s:property value="pageBean.pageNo"/>/<s:property value="pageBean.totalPageNo"/>页&nbsp;&nbsp;&nbsp;&nbsp;
							<s:if test="pageBean.pageNo != 1">
								<a href="${pageContext.request.contextPath }/adminCategory_findAll.action?pageNo=1">首页</a>|
								<a href="${pageContext.request.contextPath }/adminCategory_findAll.action?pageNo=<s:property value="pageBean.pageNo - 1"/>">上一页</a>|
							</s:if>
							<s:if test="pageBean.pageNo != pageBean.totalPageNo">
								<a href="${pageContext.request.contextPath }/adminCategory_findAll.action?pageNo=<s:property value="pageBean.pageNo + 1"/>">下一页</a>|
								<a href="${pageContext.request.contextPath }/adminCategory_findAll.action?pageNo=<s:property value="pageBean.totalPageNo"/>">尾页</a>
							</s:if>
						</div>
                    </center>
                   </form>
                </div>
            </section>
            <br/><br/>
        </section>
        
        <!-- Javascript Libraries -->
        <!-- jQuery -->
        <script src="${pageContext.request.contextPath }/js/jquery.min.js"></script> <!-- jQuery Library -->
        
        <!-- Bootstrap -->
        <script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
        
        <!-- UX -->
        <script src="${pageContext.request.contextPath }/js/scroll.min.js"></script> <!-- Custom Scrollbar -->
        
        <!-- Other -->
        <script src="${pageContext.request.contextPath }/js/calendar.min.js"></script> <!-- Calendar -->
        <script src="${pageContext.request.contextPath }/js/feeds.min.js"></script> <!-- News Feeds -->
        
        
        <!-- All JS functions -->
        <script src="${pageContext.request.contextPath }/js/functions.js"></script>
        
        <!-- From JS -->
    	<script language="javascript" src="${pageContext.request.contextPath}/js/public.js"></script>
    	<script type="text/javascript">
			function deleteCategory(cid){
				if(confirm("确定要删除该一级分类？")){
					window.location.href = "${pageContext.request.contextPath}/adminCategory_delete.action?cid=" + cid;
				}
			}
			
		</script>
		<script type="text/javascript">
			function addCategory(){
				window.location.href = "${pageContext.request.contextPath}/adminCategory_add.action";
			}
		</script>
    </body>
</html>

